package com.wz.wzbubbleai.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

import com.wz.wzbubbleai.R;
import com.wz.wzbubbleai.utils.LogUtil;
import com.wz.wzbubbleai.view.MainView;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

public class MainActivity extends Activity implements OnClickListener{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //setFullScreen();
        //setContentView(R.layout.main_view);
        //setContentView(R.layout.voice_layout);
        //Button button = findViewById(R.id.close_bt);
        //button.setOnClickListener(this);


        //MainView.showPopupWindow(MainActivity.this);
        //hideSystemUI();
        finish();
    }

    private void hideSystemUI() {
        int flag = getWindow().getDecorView().getSystemUiVisibility();

        int fullScreen = 0x8;
        if (flag == fullScreen) {
            if ((flag & fullScreen) != 0) {
                getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
            }
        }else {
            if ((flag & fullScreen) == 0) {
                getWindow().getDecorView().setSystemUiVisibility(flag | fullScreen);
            }
        }
    }

    private void setFullScreen(){
        requestWindowFeature(Window.FEATURE_NO_TITLE); //设置无标题
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }

    @Override
    public void onClick(View view) {
        LogUtil.d("onClick");
        this.finish();
    }

    class ProxyHandler implements InvocationHandler{

        @Override
        public Object invoke(Object o, Method method, Object[] objects) throws Throwable {
            return null;
        }
    }
}